# -*- coding: utf-8 -*-
"""
Created on Wed Nov 14 19:00:05 2018

@author: 陈忠涛
"""

# 说明：鸢尾花数据集
# 4个属性：萼片长度、萼片宽度、花瓣长度、花瓣宽度
# 150条数据
# 共3类（.target）：山鸢尾、变色鸢尾、弗吉尼亚鸢尾，即每类各50条数据。

from sklearn import datasets
import pandas as pd
import matplotlib.pyplot as plt
iris = datasets.load_iris()

df = iris.data # 转换成DataFrame类型数据
X = list(pd.DataFrame(df)[0])
Y = list(pd.DataFrame(df)[2])
plt.plot(X[:50], Y[:50], 'o')
plt.plot(X[50:100], Y[50:100], '*')
plt.plot(X[100:], Y[100:], 'D')


# print(iris.data.shape)
# print(iris.target)
# X = [item[0] for item in iris.data]
# Y = [item[2] for item in iris.data]

# plt.scatter(X[:50], Y[:50], color = 'red', marker = 'o', label = 'setosa')
# plt.scatter(X[50:100], Y[50:100], color = 'green', marker = '*', label = 'versicolor')
# plt.scatter(X[100:], Y[100:], color = 'blue', marker = 'D', label = 'virginica')
